﻿// ********************************** 
//  
// 大王派你去巡山
// 
// **********************************

using Microsoft.Extensions.Logging;

namespace HuaweiBarcodeScan;

public static class MauiProgram
{
    public static MauiApp CreateMauiApp()
    {
        var builder = MauiApp.CreateBuilder();
        builder
            .UseMauiApp<App>()
            .ConfigureFonts(fonts =>
            {
                fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
            });

        builder.Services.AddMauiBlazorWebView();
#if ANDROID
        var scanService = new Platforms.Android.MainActivityService();
        builder.Services.AddSingleton<IMainActivityService>(scanService);
        MainActivity.ScanService = scanService;
#endif

#if DEBUG
        builder.Services.AddBlazorWebViewDeveloperTools();
        builder.Logging.AddDebug();
#endif

        return builder.Build();
    }
}
